<!-- NO DOCTYPE -->
<html>
<head>
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, shrink-to-fit=no">
    <title></title>
</head>
<body>
<div style="height: 9000px">FILLER</div>
<div id="target">TARGET</div>
<script>
    const nativeMethods        = window['%hammerhead%'].nativeMethods;
    const originWindowScrollTo = nativeMethods.scrollTo;

    let lastScrollTop  = window.scrollY;
    let lastScrollLeft = window.scrollX;

    nativeMethods.scrollTo = function () {
        lastScrollLeft = arguments[0];
        lastScrollTop  = arguments[1];

        originWindowScrollTo.apply(window, arguments);
    };

    window.addEventListener('scroll', function () {
        if (window.scrollX !== lastScrollLeft || window.scrollY !== lastScrollTop)
            window.scrollTo(lastScrollLeft, lastScrollTop);
    });

    Object.defineProperty(document.body, 'scrollTop', {
        get: function () {
            return window.scrollY;
        },

        set: function (y) {
            window.scrollTo(window.scrollX, y);
        }
    });

    Object.defineProperty(document.body, 'scrollLeft', {
        get: function () {
            return window.scrollX;
        },

        set: function (x) {
            window.scrollTo(x, window.scrollY);
        }
    });
</script>
</body>
</html>
